-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(storage): Implement DiskTokenStorage #19
Conversation
Thanks for contributing. Unfortunately I have to tell you that there were the following issues with your Pull Request
Guidelines are available at https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines This message was auto-generated by https://gitcop.com |
DiskTokenStorage is a TokenStorage that stores its tokens in a JSON file on disk. That file can be read in later, and the tokens in it reused. (The idea for a cache file is from here: https://developers.google.com/drive/v3/web/quickstart/go)
@dermesser Thanks a lot for your contribution ! But believe it or not: I am having serious difficulty to even build this project anymore outside of it's usage in |
}; | ||
|
||
// best-effort | ||
let _ = dts.load_from_file(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though I like all aspects of the implementation, this is the part I am having a gripe with. Reason for that is that downright ignores all errors, just because there is no way for it to report them. However, to me Rust is the language that makes it easy to not go down that path.
There are two possible solutions coming to my mind:
- make
new()
return a Result - delay the initial load to the
get()
andset()
methods respectively.
What do you think about this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll just make new()
return a Result
type.
My thoughts were that new()
is just "make me a storage; if you can't read it, ignore it, I'll find out when there's no token in it". But you're absolutely right with regards to The Right Way To Do It :-)
What kind of error do you get when trying to build? I also had some initial difficulties getting it to build, but I could fix them...
It seems that the latter issue might be what you're encountering. Good luck :-) |
hmm, for some reason I get |
nvm, that's #24 |
@@ -14,7 +14,7 @@ build = "src/build.rs" | |||
chrono = ">= 0.2" | |||
log = ">= 0.3" | |||
mime = ">= 0.1" | |||
url = ">= 0.5" | |||
url = "= 0.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this probably ends up as merge conflict (and I'll revert it), but otherwise it doesn't build
friendly ping :-) (just saw that a commit fixing the dependencies made it into this PR. If I should remove it, tell me) |
Oh, please don't remove it, it is just that I didn't thoroughly look at it yet since the first review. Next week I am on holiday and will thus have time. Do you think that is soon enough? |
oh sure! I just pinged it to avoid the PR(s) being buried and forgotten. As long as I know that you know about it, I'm fine :) |
I managed to get it to build on nightly now, using mostly latest versions of dependencies. Stable can't work anymore, apparently due to this issue. My goal is to bring google-apis-rs back to work in nightly for now, and if necessary do whatever is needed to resolve the |
DiskTokenStorage is a TokenStorage that stores its tokens in a JSON file
on disk. That file can be read in later, and the tokens in it reused.
(The idea for using a cache file is from here:
https://developers.google.com/drive/v3/web/quickstart/go#step_3_set_up_the_sample)